<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div>
      <p>
        <div class="span1"></div>
        <div class="span2"></div>
        <div class="span3"></div>
      </p>
    </div>
    <script>
      let reg = /[a-zA-Z]{2}/;
      let str =
        "my name is jq,my age is 13 years old,Ieee bevelive I am a good man,so love me";
      let span1 = document.querySelector(".span1");
      let span2 = document.querySelector(".span2");
      let span3 = document.querySelector(".span3");
      let str1 = "",
        str2 = "",
        str3 = "";
      str1 = str.slice(0, 12);
      str2 = str.slice(12, 38);
      str3 = str.slice(38);
      let newStr = str.charAt(11) + str.charAt(12);
      reg.test(newStr) ? (str1 = str1 + "-") : "";
      newStr = str.charAt(37) + str.charAt(38);
      reg.test(newStr) ? (str2 = str2 + "-") : "";
      span1.innerHTML = str1;
      span2.innerHTML = str2;
      span3.innerHTML = str3;
    </script>
  </body>
</html>
